package com.example.demo.validation.dto;

import lombok.Data;
import lombok.RequiredArgsConstructor;

import lombok.extern.slf4j.Slf4j;

/**
 * @author jiangjinwu
 * @version 1.0
 * @since 2025/10/4 10:35
 */

@Slf4j
// src/main/java/com/example/validation/dto/RuleFormDTO.java
@Data
public class RuleFormDTO {
  private Long id;
  private String fieldName;
  private String ruleType;
  private String ruleValue;
  private String message;
  private Integer orderIndex;

  // 用于表单绑定
  public void setOrderIndex(Integer orderIndex) {
    this.orderIndex = orderIndex != null ? orderIndex : 0;
  }
}
